import request from "@/utils/request";

export function deleteBatch(data) {
    return request({
        url: 'teams',
        method: 'delete',
        data
    })
}

export function addBatch(data){

    return request({
        url: 'teams',
        method: 'post',
        data
    })
}
export function updateBatch(data){

    return request({
        url: 'teams',
        method: 'put',
        data
    })
}


export function getBatchPage (currentPage, pageSize){
    return request({
        url: 'teams/page',
        params: {
            currentPage,
            pageSize,
        },
    })
}
export function addParticipant(data){
    return request({
        url: 'testPer',
        method: 'post',
        data
    })
}
export function importParticipants(teamId, file) {
    const formData = new FormData();
    formData.append('file', file); // 将文件添加到 FormData 对象

    return request({
        url: `testPer/import/${teamId}`, // 正确的路径参数
        method: 'post',
        data: formData,
        headers: {
            'Content-Type': 'multipart/form-data', // 设置请求头，指明上传的是文件
        },
    });
}

